<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>initializeArrayWithRangeRight</title>
</head>
<body>
    <div id="content"></div>
    <script>
        const initializeArrayWithRangeRight = (end,start = 0,step = 1) => Array.from({ length: Math.ceil((end - start  + 1)/ step)}).map((_,i,arr) => (arr.length - i - 1) * step + start);
        document.querySelector('#content').innerHTML = `
            <div class="result-1">
                initializeArrayWithRangeRight(5):
                &nbsp;&nbsp;
                ${JSON.stringify(initializeArrayWithRangeRight(5))}
            </div>
            <div class="result-2">
                initializeArrayWithRangeRight(7, 3):
                &nbsp;&nbsp;
                ${JSON.stringify(initializeArrayWithRangeRight(7, 3))}
            </div>
            <div class="result-3">
                initializeArrayWithRangeRight(9, 0, 2):
                &nbsp;&nbsp;
                ${JSON.stringify(initializeArrayWithRangeRight(9, 0, 2))}
            </div>
        `;
    </script>
</body>
</html>